//
//  BossBodyScene.m
//  ShoutBoss
//
//  Created by Luck Mstone on 6/15/09.
//  Copyright 2009 MS. All rights reserved.
//

#import "BossBodyScene.h"
#import "BossBodyBackGround.h"
#import "BossBodyScene/BodyLayer.h"
#import "MenuItem.h"
#import "Menu.h"
#import "cocos2d.h"
#import "BossHeadScene.h"

@implementation BossBodyScene

-(id) init
{
	self = [super init];
	if(self != nil){
		//BossBodyScene 初始化工作
		//背景精灵
		CGSize s = [[Director sharedDirector] winSize];
		BossBodyBackGround* background = [BossBodyBackGround node];
		[self addChild:background];
		[background setPosition: ccp(s.width/2, s.height/2)];
		
		//菜单选项
		MenuItem *menuItem1 = [MenuItemFont itemFromString:@"Done" target:self selector:@selector(onDone:)];

		Menu *menu = [Menu menuWithItems:menuItem1,nil];
		[menu alignItemsVertically];
		
		[self addChild:menu];
		
		//老板身体层
		BodyLayer *bodylayer = [BodyLayer node];
		
		[self addChild:bodylayer];
	}
	
	return self;
}

-(void)onDone:(id)sender
{
	// 切换到BossHead
	BossHeadScene* bossHeadScene = [BossHeadScene node];
	[[Director sharedDirector] replaceScene:bossHeadScene];
}

@end
